(function(){
	
	nsbase.views.login = new LoginFunc();

	function LoginFunc() {
		
		var self = this;

		self.init = _init;


		function _init () {
			initForm();
		}

		function initForm () {
			var $loginForm = $('#loginForm'),
			$txtUserName = $('#txtUserName'),
			$txtPwd = $('#txtPwd'),
			$chkRember = $('#chkRember'),
			$btnLogin = $('#btnLogin');

			var cssClass = {
				unOn:"on-un",
				pwdOn:"on-pwd",
				checked:"checked"
			};
			$txtUserName.focus(function() {
				$loginForm.addClass(cssClass.unOn);
			});
			$txtPwd.focus(function() {
				$loginForm.addClass(cssClass.pwdOn);
			});
			$txtUserName.blur(function(){
				$loginForm.removeClass(cssClass.unOn);
			});
			$txtPwd.blur(function () {
				$loginForm.removeClass(cssClass.pwdOn);
			});
			
			$chkRember.click(function() {
				var $chkBox = $chkRember.find('.checkbox');
				if ($chkBox.hasClass(cssClass.checked)){
					$chkBox.removeClass(cssClass.checked);
				} else{
					$chkBox.addClass(cssClass.checked);
				} 
			});

			//$btnLogin.click(function() {
				
			//});
		}
	}

})();